#! /usr/bin/env python
#*  All rights reserved.
#*
#*  Redistribution and use in source and binary forms, with or without
#*  modification, are permitted provided that the following conditions
#*  are met:
#*
#*   * Redistributions of source code must retain the above copyright
#*     notice, this list of conditions and the following disclaimer.
#*   * Redistributions in binary form must reproduce the above
#*     copyright notice, this list of conditions and the following
#*     disclaimer in the documentation and/or other materials provided
#*     with the distribution.
#*   * Neither the name of the Willow Garage nor the names of its
#*     contributors may be used to endorse or promote products derived
#*     from this software without specific prior written permission.
#*
#*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
#*  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
#*  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
#*  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
#*  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
#*  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
#*  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
#*  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
#*  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
#*  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
#*  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
#*  POSSIBILITY OF SUCH DAMAGE.
#***********************************************************

# Author: John Hsu
# Gazebo ode physics configuration

PACKAGE='gazebo_ros'

from math import pi

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()
#        Name                          Type      Reconfiguration level             Description                                                                                                 Default    Min   Max
gen.add( "time_step"                 , double_t, 1                            ,    "Simulation world time step size in seconds, smaller time steps producesslower, more stable simulation."  , 0.001    , 0   , 10)
gen.add( "max_update_rate"           , double_t, 1                            ,    "Simulator max update rate, -1 unlimited, 1 restricts to real-time if possible."                          , 60       , 0   , 1000)
gen.add( "gravity_x"                 , double_t, 1                            ,    "Simulated gravity in the x direction."                                                                   , 0        , -100, 100)
gen.add( "gravity_y"                 , double_t, 1                            ,    "Simulated gravity in the y direction."                                                                   , 0        , -100, 100)
gen.add( "gravity_z"                 , double_t, 1                            ,    "Simulated gravity in the z direction."                                                                   , -9.8     , -100, 100)
gen.add( "auto_disable_bodies"       , bool_t  , 1                            ,    "Auto disable of bodies in simulation if body it's not moving."                                           , False)
gen.add( "sor_pgs_precon_iters"      , int_t   , 1                            ,    "Number of preconditioning iterations for SOR PGS LCP as implemented in quickstep."                       , 0        , 0   , 10000)
gen.add( "sor_pgs_iters"             , int_t   , 1                            ,    "Number of iterations for SOR PGS LCP as implemented in quickstep."                                       , 20       , 0   , 10000)
gen.add( "sor_pgs_w"                 , double_t, 1                            ,    "Relaxation parameter for SOR PGS LCP, usually set to 1.3, but reduce to stabilize simulation."           , 1.3      , 0   , 5)
gen.add( "sor_pgs_rms_error_tol"     , double_t, 1                            ,    "The number of scans to skip between each measured scan"                                                  , -1       , -1  , 10000)
gen.add( "cfm"                       , double_t, 1                            ,    "Constraint Force Mixing per ODE's users manual."                                                         , 0        , 0   , 10)
gen.add( "erp"                       , double_t, 1                            ,    "Error Reduction Parameter per ODE's users manual."                                                       , 0.2      , 0   , 10)
gen.add( "contact_surface_layer"     , double_t, 1                            ,    "Margin for penetration for which restorative forces are not applied."                                    , 0.001    , 0   , 10)
gen.add( "contact_max_correcting_vel", double_t, 1                            ,    "Maximum contact penetration correction velocity."                                                        , 100      , 0   , 10000000)
gen.add( "max_contacts"              , int_t   , 1                            ,    "Maximum number of contacts between any 2 bodies."                                                        , 100      , 0   , 10000000)

exit(gen.generate(PACKAGE, "physics_node", "Physics"))
